Ext.define('extjs6test.view.core.UserDashboardController', {
    extend: 'Ext.app.ViewController',
    alias: 'controller.core-userdashboard',
    requires: [
        'extjs6test.store.User',
        'extjs6test.view.core.UserProfile'
    ],
    onUserDashboardRender: function (me) {
        var userStore = new extjs6test.store.User();
        userStore.on('load', function (store, records, successful, eOpts) {
            Ext.each(records, function (record) {
                var userName = record.data.userName;
                var item = me.add({xtype: 'userprofile'});
                item.getViewModel().set('Someone', userName);
            });

        });
        userStore.load();
    }
});
